package com.guigu.servicesystem.mapper;

import com.guigu.servicesystem.entity.TbResource;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.guigu.servicesystem.entity.vo.Resource_menuVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author testjava
 * @since 2020-07-09
 */
public interface TbResourceMapper extends BaseMapper<TbResource> {
    //查询对应角色的菜单跟权限
    @Select("SELECT * FROM tb_role a,tb_role_resource b,tb_resource c,tb_resource_menu d,tb_menu e WHERE a.id=b.role_id AND b.resource_id=c.id AND c.id=d.resource_id AND d.menu_id =e.id AND a.id=#{id}")
    List<Resource_menuVo> selectResourse_menu(@Param("id") int id);
}
